# eric7.Plugins.PluginCodeStyleChecker

Module implementing the code style checker plug-in.

### Global Attributes

__header__
error

### Classes

CodeStyleCheckerPlugin | Class implementing the code style checker plug-in.

### Functions

None

## CodeStyleCheckerPlugin

Class implementing the code style checker plug-in.

### Signals

batchFinished()
  emitted when a style check batch is done
error(str, str)
  emitted in case of an error
styleChecked(str, dict, int, list)
  emitted when the style check was done for a file.

### Derived from

QObject

### Class Attributes

None

### Class Methods

None

### Methods

CodeStyleCheckerPlugin | Constructor
__editorClosed | Private slot called, when an editor was closed.
__editorCodeStyleCheck | Private slot to handle the code style check context menu action of the editors.
__editorOpened | Private slot called, when a new editor was opened.
__editorShowMenu | Private slot called, when the the editor context menu or a submenu is about to be shown.
__initialize | Private slot to (re)initialize the plugin.
__projectBrowserCodeStyleCheck | Private method to handle the code style check context menu action of the project sources browser.
__projectBrowserShowMenu | Private slot called, when the the project browser menu or a submenu is about to be shown.
__projectCodeStyleCheck | Private slot used to check the project files for code style.
__projectShowMenu | Private slot called, when the the project menu or a submenu is about to be shown.
__serviceError | Private slot handling service errors.
__translateStyleCheck | Private slot called after performing a style check on one file.
activate | Public method to activate this plugin.
batchJobDone | Public slot handling the completion of a batch job.
cancelStyleBatchCheck | Public method to cancel all batch jobs.
deactivate | Public method to deactivate this plugin.
serviceErrorPy3 | Public slot handling service errors for Python 3.
styleBatchCheck | Public method to prepare a style check on multiple Python source files.
styleCheck | Public method to prepare a style check on one Python source file.

### Static Methods

None

#### CodeStyleCheckerPlugin (Constructor)

CodeStyleCheckerPlugin(ui)

Constructor

ui (UserInterface)
  reference to the user interface object

#### CodeStyleCheckerPlugin.__editorClosed

__editorClosed(editor)

Private slot called, when an editor was closed.

editor (Editor)
  reference to the editor

#### CodeStyleCheckerPlugin.__editorCodeStyleCheck

__editorCodeStyleCheck()

Private slot to handle the code style check context menu action of the editors.

#### CodeStyleCheckerPlugin.__editorOpened

__editorOpened(editor)

Private slot called, when a new editor was opened.

editor (Editor)
  reference to the new editor

#### CodeStyleCheckerPlugin.__editorShowMenu

__editorShowMenu(menuName, menu, editor)

Private slot called, when the the editor context menu or a submenu is about to be shown.

menuName (str)
  name of the menu to be shown
menu (QMenu)
  reference to the menu
editor (Editor)
  reference to the editor

#### CodeStyleCheckerPlugin.__initialize

__initialize()

Private slot to (re)initialize the plugin.

#### CodeStyleCheckerPlugin.__projectBrowserCodeStyleCheck

__projectBrowserCodeStyleCheck()

Private method to handle the code style check context menu action of the project sources browser.

#### CodeStyleCheckerPlugin.__projectBrowserShowMenu

__projectBrowserShowMenu(menuName, menu)

Private slot called, when the the project browser menu or a submenu is about to be shown.

menuName (str)
  name of the menu to be shown
menu (QMenu)
  reference to the menu

#### CodeStyleCheckerPlugin.__projectCodeStyleCheck

__projectCodeStyleCheck()

Private slot used to check the project files for code style.

#### CodeStyleCheckerPlugin.__projectShowMenu

__projectShowMenu(menuName, _menu)

Private slot called, when the the project menu or a submenu is about to be shown.

menuName (str)
  name of the menu to be shown
_menu (QMenu)
  reference to the menu (unused)

#### CodeStyleCheckerPlugin.__serviceError

__serviceError(fn, msg)

Private slot handling service errors.

fn (str)
  file name
msg (str)
  message text

#### CodeStyleCheckerPlugin.__translateStyleCheck

__translateStyleCheck(fn, codeStyleCheckerStats, results)

Private slot called after performing a style check on one file.

fn (str)
  filename of the just checked file
codeStyleCheckerStats (dict)
  stats of style and name check
results (dict)
  dictionary containing the check result data (see CodesStyleChecker.__checkCodeStyle for details)

#### CodeStyleCheckerPlugin.activate

activate()

Public method to activate this plugin.

Return:
  tuple of None and activation status

Return Type:
  bool

#### CodeStyleCheckerPlugin.batchJobDone

batchJobDone(fx, lang)

Public slot handling the completion of a batch job.

fx (str)
  service name
lang (str)
  language

#### CodeStyleCheckerPlugin.cancelStyleBatchCheck

cancelStyleBatchCheck()

Public method to cancel all batch jobs.

#### CodeStyleCheckerPlugin.deactivate

deactivate()

Public method to deactivate this plugin.

#### CodeStyleCheckerPlugin.serviceErrorPy3

serviceErrorPy3(fx, lang, fn, msg)

Public slot handling service errors for Python 3.

fx (str)
  service name
lang (str)
  language
fn (str)
  file name
msg (str)
  message text

#### CodeStyleCheckerPlugin.styleBatchCheck

styleBatchCheck(argumentsList)

Public method to prepare a style check on multiple Python source files.

argumentsList (list of tuple of (str, str, list))
  list of arguments tuples with each tuple containing filename, source and args as given in styleCheck() method

#### CodeStyleCheckerPlugin.styleCheck

styleCheck(lang, filename, source, args)

Public method to prepare a style check on one Python source file.

lang (str or None)
  language of the file or None to determine by internal algorithm
filename (str)
  source filename
source (list of str)
  list of code lines to be checked
args (list of (str, str, bool, str, str, bool, int, list of (int, int),)
  arguments used by the codeStyleCheck function (list of excludeMessages, includeMessages, repeatMessages, fixCodes, noFixCodes, fixIssues, maxLineLength, blankLines, hangClosing, docType, codeComplexityArgs, miscellaneousArgs, errors, eol, encoding, backup) bool, str, dict, dict, list of str, str, str, bool)

Up